<?php
// +----------------------------------------------------------------------
// | EtrolPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Author:LJQ <liujiqi@etrol.com>
// +-----------------------------------------------------------------------

namespace app\duty\model;

use app\common\model\Base;
use app\common\model\User;
/**
 * 消息管理
 */
class News extends Base{
	

	protected $name = 'news';
	protected $createTime = 'createTime';
	protected $updateTime = 'updateTime';
	
	public $newsTypeList=[] ;

	public  function getType(){

	 $newsType=db('basicinfo')->where(array('sysCode'=>27))->column('subsystemName','subsystemNo');
	 $this->newsTypeList=$newsType;
	 return $this->newsTypeList;
	}



	public function gettypeIdAttr($value,$data){
		$this->getType();
		if($data['typeId']){
			return $this->newsTypeList[$data['typeId']];
		}
		return null;
	}

	public function user() {
		return $this->hasOne(User::class,'id','sendPersonId');
	}
}